IOMMU: don't BUG() on exotic hardware
authorJan Beulich <jbeulich@suse.com>
Mon, 9 May 2016 11:21:06 +0000 (13:21 +0200)
committerJan Beulich <jbeulich@suse.com>
Mon, 9 May 2016 11:21:06 +0000 (13:21 +0200)
commit94a6187794b1ef4f5d35ff746699f588831818f2
tree2a0b3020fd147ad269d401bc6371402e1cfbe89b
parentf8c66c2ad2efdb281e4ebf15bf329d73c4f02ce7
IOMMU: don't BUG() on exotic hardware

On x86, iommu_get_ops() BUG()s when running on non-Intel, non-AMD
hardware. While, with our current code, that's a correct prerequisite
assumption for IOMMU presence, this is wrong on systems without IOMMU.
Hence iommu_enabled (and alike) checks should be done prior to calling
that function, not after.

Also move iommu_suspend() next to iommu_resume() - it escapes me why
iommu_do_domctl() had got put between the two.

Signed-off-by: Jan Beulich <jbeulich@suse.com>
Reviewed-by: Dario Faggioli <dario.faggioli@citrix.com>
Release-acked-by: Wei Liu <wei.liu2@citrix.com>
xen/drivers/passthrough/iommu.c
xen/drivers/passthrough/pci.c